﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UPMS.Core.Domain.Mapping
{
    public class AccountMap : BaseMap<Account>
    {
        public AccountMap()
        {
            this.ToTable("Upms_tbl_Account");
            this.Property(a => a.ApplicationId).HasColumnName("ApplicationId").IsRequired();
            this.Property(a => a.Name).HasColumnName("Name").IsRequired().HasMaxLength(64);
            this.Property(a => a.Password).HasColumnName("Password").IsRequired();
            this.Property(a => a.Status).HasColumnName("Status").IsRequired();

            this.HasRequired(a => a.Application).WithMany(app => app.Accounts).HasForeignKey(a => a.ApplicationId);
          
        }
    }
}
